package com.tongcao.cn.domain.entity;

import lombok.Data;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Min;
import java.io.Serializable;

/**
 * @Author:tongcao
 * @Date:2018/8/26 10:56
 * Description:引入validatar 校验框架
 */
@Data
public class UserEntity implements Serializable {

    @NotBlank
    @Length(min = 2, max = 10)
    private String name;


    @Min(1)
    private int age;

    @NotBlank
    @Email
    private String mail;
}
